package com.hmkj.core.service.follow.impl;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.common.baseMapper.GenericPo;
import com.hmkj.core.mapper.follow.FollowRuleMapper;
import com.hmkj.core.po.follow.FollowRule;
import com.hmkj.core.service.follow.FollowRuleService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 跟单规则表业务相关Service接口实现<br>
 *
 * @ClassName: FollowRuleServiceImpl
 * @author bin
 * @date   2017-11-19 01:54:10
 */
@Service
@Scope("prototype")
@Transactional(rollbackFor = Exception.class)
public class FollowRuleServiceImpl implements FollowRuleService {

	@Resource
    private FollowRuleMapper followRuleMapper;

    @Override
    public GenericMapper<FollowRule,Integer> _getMapper() {
        return followRuleMapper;
    }

    @Override
    public Integer selcetCountByFollowId(Integer id) {
        Map<String, Object> params = new HashMap<>();
        params.put("followId",id);
        params.put("status",FollowRule.STATUS.T1.code);
        params.put("delFlag",FollowRule.DELFLAG.NORMAL.code);
        return followRuleMapper.selcetCountByFollowId(params);
    }
}
